/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package generating;

import bl.StarSystem;
import java.util.ArrayList;
import resources.SpaceGeneration;

/**
 *
 * @author Alexander_Seiner
 */
public class GalaxyGenerator 
{
    public ArrayList<StarSystem> getSystems(String core, int arms, double size)
    {
        return new ArrayList<StarSystem>();
    }
    public String getCoreType()
    {
        return SpaceGeneration.galaxyCores.get((SpaceGeneration.seed + SpaceGeneration.getRndCounter())%(SpaceGeneration.galaxyCores.size()));
    }
    public int getArms()
    {
        return SpaceGeneration.galaxyArms.get((SpaceGeneration.seed + SpaceGeneration.getRndCounter())%(SpaceGeneration.galaxyArms.size()));
    }
    public double getSize()
    {
        return SpaceGeneration.getGalaxySize.get((SpaceGeneration.seed + SpaceGeneration.getRndCounter())%(SpaceGeneration.getGalaxySize.size()));
    }
    public int[] getArmStartAngles(int arms)
    {
        int[] armStartAngles = new int[arms];
        if(arms > 0)
        {
            armStartAngles[0] = 0;
            int i = 1;
            while(i < arms/2)
            {
                int z;
                boolean vorhanden = false;
                do
                {
                    vorhanden = false;
                    z = (SpaceGeneration.seed + SpaceGeneration.getRndCounter())%(18-(i-1));
                    for(int j : armStartAngles)
                    {
                        if(j == z)
                        {
                            vorhanden = true;
                        }
                    }
                }while(vorhanden == true);
                armStartAngles[i] = z*10;
                i++;
            }
            for(i = 0; i < arms/2; i++)
            {
                armStartAngles[i+arms/2] = armStartAngles[i]+180;
            }
        }
        return armStartAngles;
    }
    
    public int getArmRotation()
    {
        return SpaceGeneration.getArmRotation.get((SpaceGeneration.seed + SpaceGeneration.getRndCounter())% SpaceGeneration.getArmRotation.size());
    }
    
    
}
